const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('sys_report_file', {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "主键"
    },
    name: {
      type: DataTypes.STRING(100),
      allowNull: false,
      comment: "文件名"
    },
    content: {
      type: DataTypes.BLOB,
      allowNull: true,
      comment: "文件内容"
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "创建时间",
      field: 'create_time'
    },
    updateTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "更新时间",
      field: 'update_time'
    },
    isDeleted: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 0,
      comment: "是否已删除",
      field: 'is_deleted'
    }
  }, {
    sequelize,
    tableName: 'sys_report_file',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
